/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package menu;

import czStvDpds.centrallogic.Logic;
import czStvDpds.graphics3D.Drawing;
import czStvDpds.graphics3D.GraphicsIndex;
import czStvDpds.graphics3D.gui.ButtonEvent;
import czStvDpds.graphics3D.gui.ButtonListener;
import czStvDpds.graphics3D.gui.LCardContainer;
import czStvDpds.graphics3D.gui.LComponent;
import czStvDpds.graphics3D.gui.SuperContainer;

/**
 *
 * @author Ondra
 */
public class TitleMenu implements ButtonListener {

    private static LCardContainer container;
    private static TitleMenu titleMenu;
    private static Drawing d;
    private static boolean initialized = false;

    public static void init(Logic logic) {
        d = GraphicsIndex.getDrawing();
        container = SuperContainer.create(SuperContainer.TITLE_MENU, d.getGUIScene(SuperContainer.TITLE_MENU));
        titleMenu = new TitleMenu(logic);

        initialized = true;
    }

    public static void toggleVisibility() {
        if (!initialized) {
           throw new UnsupportedOperationException("menu not initialized");
        }
        SuperContainer.switchContainer(SuperContainer.TITLE_MENU);
        d.setGUISceneVisibility(SuperContainer.TITLE_MENU, !d.getGUISceneVisibility(SuperContainer.TITLE_MENU));

        container.showComponent(0);
    }
    
    private Logic logic;

    private TitleMenu(Logic logic) {
        this.logic = logic;
        //TODO
    }

    @Override
    public void buttonClicked(ButtonEvent e) {
        LComponent c = e.getSource();
    }
}
